<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@ page import="java.util.*"%>
    
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>Friends List</title>
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
  </head>
  <body>
  	<table border="1">
  		<tbody>
  		<tr>
			<td>Name</td>
			<td>&nbsp;</td>
		</tr>
	  <%
	  	ArrayList<String> friends = (ArrayList<String>)request.getAttribute("friends");
	  	
	  	for (Iterator<String> iter = friends.iterator(); iter.hasNext();) {
	  		String element = (String) iter.next();
			out.println("<tr>");
			out.println("<td>" + element + "</td>");
			out.println("<td><a href=\"editFriend?do=delete&name=" + element + "\">Delete</a></td>");
			out.println("</tr>");
	  	}
	  %>
  		</tbody>
  	</table>
  	<br>
  	<a href="editFriend?do=add">Add a new friend</a>
  	<br>
  	<a href="viewForums">Back to Forums</a>
  	<br>
  	<a href="logout">logout</a>
  	
  </body>
</html>